<?php
/**
 *
 * UCConfMedal class file
 *
 * @category   UC
 * @author     刘海涛 <liuhaitao01@snda.com>
 * @copyright  SDO Group
 * @version    Release: 1.0.0
 * @link       
 * @license    http://www.sdo.com
 */
require_once(dirname(__FILE__).'/UCConfMacro.php');
define('MEDAL_AVATAR_URL',UC_CONF_UC_DOMAIN.'/user/profile/?act=view&to=2');
define('MEDAL_INVITE_URL',UC_CONF_UC_DOMAIN.'/invite');
define('MEDAL_SEARCH_URL',UC_CONF_UC_DOMAIN.'/search');
define('MEDAL_TUITA_URL',UC_CONF_UC_DOMAIN.'/tuita');
define('MEDAL_PANDUOLA_URL',UC_CONF_UC_DOMAIN.'/store/app/id/1000000009');
define('MEDAL_PAOPAOYU_URL',UC_CONF_UC_DOMAIN.'/store/app/id/1000000082');
define('MEDAL_KONGLONG_URL',UC_CONF_UC_DOMAIN.'/store/app/id/1000000112');
define('MEDAL_PAOPAOYU_URL',UC_CONF_UC_DOMAIN.'/store/app/id/1000000082');
define('MEDAL_VIP_URL','http://jf.sdo.com/Help.aspx?innerIndex=ScoreRule&pid=1');
define('MEDAL_REQUEST_PANDUOLA','http://77wa.com/level_callback.php');
define('MEDAL_REQUEST_PAOPAOPYU','http://sdo.paopaoyu.cn/sdo_medal/');
define('MEDAL_REQUEST_KONGLONG','http://sdo.dino-age.com/medal.php');
define('MEDAL_REQUEST_MINGXING','http://dream.sdo.ctrl1.com/sdo/medal.aspx');

class UCConfMedal
{
	const MEDAL_DB_FLAG				= 'user_medal';
	const MEDAL_MEMCACHE_FLAG		= 'medal';
	const MEDAL_MEMCACHE_KEY_USER_LIST		= 'sdo_uc_medal_user_';
	const MEDAL_MEMCACHE_KEY_FRIEND_BILLBORD	= 'sdo_uc_user_medal_bb_';
	const MEDAL_MEMCACHE_KEY_FEED	= 'sdo_uc_medal_feed';
	const MEDAL_MEMCACHE_KEY_FEED_BACKUP	= 'sdo_uc_medal_feed_backup';
	const MEDAL_PANDUOLA_KEY				= 'UC_MEDAL_PANDUOLA';
	const MEDAL_PAOPAOYU_KEY				= 'UC_MEDAL_PAOPAOYU';
	const MEDAL_KONGLONG_KEY				= 'UC_MEDAL_KONGLONG';
	const MEDAL_MINGXING_KEY				= 'UC_MEDAL_MINGXING';

	const MEDAL_MEMCACHE_USER_LIST_EXPIRE	= 604800;	//失效时间7天
	const MEDAL_MEMCACHE_FEED_EXPIRE	= 2592000;  //失效时间30天
	const MEDAL_MEMCACHE_FRIEND_BILLBORD_EXPIRE	= 300;  //失效时间5分钟
	const MEDAL_FRIEND_INTER	= 1;	//双向好友
	const MEDAL_FRIEND_SINGEL	= 2;	//单向好友
	const MEDAL_FRIENDS_LIST_NUM	= 10;	//勋章好友列表展示数量
	const MEDAL_FRIENDS_LIST_CACHE_NUM = 50; //勋章好友列表缓存好友数量
	const MEDAL_SITE_COUNT	= 6;	//首页勋章展示数量
	const MEDAL_SPECIAL_BASE	= 4;	//特殊勋章参考基数
	const MEDAL_FEED_LIST_COUNT	= 5;	//勋章页动态展示数量

	const MEDAL_USER_LAST_LOGIN_DAYS	= 7;	//勋章获取条件
	const MEDAL_USER_TOTAL_LOGIN_DAYS	= 200;	//勋章获取条件：累计登录天数 200
	const MEDAL_USER_INVITE_FIVE	= 5;	//勋章获取条件：5
	const MEDAL_USER_INVITE_TEN		= 10;	//勋章获取条件：10
	const MEDAL_USER_INVITE_TWENTY	= 20;	//勋章获取条件：20
	const MEDAL_USER_FANS_TEN		= 10;	//勋章获取条件：10
	const MEDAL_USER_FANS_FIFTY		= 50;	//勋章获取条件：50
	const MEDAL_USER_FANS_FIVEHUNDRED	= 500;	//勋章获取条件：500
	const MEDAL_USER_TWITTER_TEN		= 10;	//勋章获取条件：10
	const MEDAL_USER_TWITTER_HUNDRED	= 100;	//勋章获取条件：100
	const MEDAL_USER_TWITTER_FIVEHUNDRED	= 500;	//勋章获取条件：500
	const MEDAL_USER_IDENTITY_GOLD		= 2;	
	const MEDAL_USER_IDENTITY_RHOD	= 3;
	const MEDAL_USER_IDENTITY_DIAMOND	= 4;

	const MEDAL_STATUS_ON	= 1;		//勋章有效
	const MEDAL_STATUS_OFF	= 0;		//勋章无效
	const MEDAL_STATUS_UNDEFINED	= -1;		//勋章
	
	const MEDAL_USER_STATUS_DONEANDHAVE		= 3;	//勋章任务已完成，勋章已认领
	//const MEDAL_USER_STATUS_DONENOHAVE	= 2;	//勋章任务已完成，勋章无认领
	const MEDAL_USER_STATUS_GET				= 1;	//勋章任务已领取
	const MEDAL_USER_STATUS_NOGET			= 0;	//勋章任务无领取
	const MEDAL_USER_STATUS_DELETE			= -1;	//勋章异常删除

	const MEDAL_TYPE_ACTIVITY	= 1;
	const MEDAL_TYPE_INVITE		= 2;
	const MEDAL_TYPE_FANS		= 3;
	const MEDAL_TYPE_TWITTER	= 4;
	const MEDAL_TYPE_IDENTITY	= 5;
	const MEDAL_TYPE_PANDUOLA	= 6;
	const MEDAL_TYPE_PAOPAOYU	= 7;
	const MEDAL_TYPE_KONGLONG	= 8;
	const MEDAL_TYPE_MINGXING	= 9;
	const MEDAL_TYPE_LIMIT		= 98;
	const MEDAL_TYPE_SPECIAL	= 99;

	const MEDAL_TYPE_ACTIVITY_NAME	= '活跃指数';
	const MEDAL_TYPE_INVITE_NAME	= '邀请好友';
	const MEDAL_TYPE_FANS_NAME		= '人气指数';
	const MEDAL_TYPE_TWITTER_NAME	= '盛大推他';
	const MEDAL_TYPE_IDENTITY_NAME	= '盛大身份';
	const MEDAL_TYPE_PANDUOLA_NAME	= '潘多拉';
	const MEDAL_TYPE_PAOPAOYU_NAME	= '泡泡鱼';
	const MEDAL_TYPE_KONGLONG_NAME	= '恐龙时代';
	const MEDAL_TYPE_MINGXING_NAME	= '明星梦工场';
	const MEDAL_TYPE_LIMIT_NAME		= '限量勋章';
	const MEDAL_TYPE_SPECIAL_NAME	= '特别勋章';

	const MEDAL_ACTIVITY_FRESH		= 101;
	const MEDAL_ACTIVITY_FAITH		= 102;
	const MEDAL_ACTIVITY_FANS		= 103;
	const MEDAL_INVITE_GENERAL		= 201;
	const MEDAL_INVITE_ENJOY		= 202;
	const MEDAL_INVITE_CRAZY		= 203;
	const MEDAL_FANS_FRIEND			= 301;
	const MEDAL_FANS_LOVE			= 302;
	const MEDAL_FANS_STAR			= 303;
	const MEDAL_TWITTER_GROUP		= 401;
	const MEDAL_TWITTER_LEADER		= 402;
	const MEDAL_TWITTER_LOAD		= 403;
	const MEDAL_IDENTITY_GOLD		= 501;
	const MEDAL_IDENTITY_RHOD		= 502;
	const MEDAL_IDENTITY_DIAMOND	= 503;
	const MEDAL_PANDUOLA_COPPER		= 601;
	const MEDAL_PANDUOLA_SILVER		= 602;
	const MEDAL_PANDUOLA_GOLD		= 603;
	const MEDAL_PAOPAOYU_1			= 701;
	const MEDAL_PAOPAOYU_2			= 702;
	const MEDAL_PAOPAOYU_3			= 703;
	const MEDAL_KONGLONG_1			= 801;
	const MEDAL_KONGLONG_2			= 802;
	const MEDAL_KONGLONG_3			= 803;
	const MEDAL_MINGXING_1			= 901;
	const MEDAL_MINGXING_2			= 902;
	const MEDAL_MINGXING_3			= 903;
	const MEDAL_LIMIT_NEICE			= 9801;
	const MEDAL_LIMIT_LONGZHIGU		= 9802;
	const MEDAL_LIMIT_BANGBANGTANG	= 9803;
	const MEDAL_SPECIAL_PLAYBOY		= 9901;
	const MEDAL_SPECIAL_SHOWMAN		= 9902;
	const MEDAL_SPECIAL_SUPERMAN	= 9903;

	const MEDAL_ERROR_PARAM			= -1;
	const MEDAL_ERROR_DB			= -2;
	const MEDAL_ERROR_INTERFACE		= -3;
	const MEDAL_ERROR_ILLEGAL		= -4;
	const MEDAL_ERROR_REQUEST		= -5;
	const MEDAL_ERROR_MEMCACHE		= -5;

	static public $ar_medal_site = array(
											self::MEDAL_ACTIVITY_FRESH,
											self::MEDAL_INVITE_GENERAL,
											self::MEDAL_FANS_FRIEND,
											self::MEDAL_TWITTER_GROUP,
											self::MEDAL_IDENTITY_GOLD,
											self::MEDAL_SPECIAL_PLAYBOY,
										);
	//错误返回信息
	static public $ar_medal_error = array(
											self::MEDAL_ERROR_PARAM			=> '参数传递错误',
											self::MEDAL_ERROR_DB			=> '数据库操作错误',
											self::MEDAL_ERROR_INTERFACE		=> '接口错误',
											self::MEDAL_ERROR_ILLEGAL		=> '操作非法',
											self::MEDAL_ERROR_REQUEST		=> '请求失败',
										);

	//勋章分类配置数组
	static public $ar_type_info = array(
										self::MEDAL_TYPE_ACTIVITY	=> self::MEDAL_TYPE_ACTIVITY_NAME,
										self::MEDAL_TYPE_INVITE		=> self::MEDAL_TYPE_INVITE_NAME,
										self::MEDAL_TYPE_FANS		=> self::MEDAL_TYPE_FANS_NAME,
										self::MEDAL_TYPE_TWITTER	=> self::MEDAL_TYPE_TWITTER_NAME,
										self::MEDAL_TYPE_IDENTITY	=> self::MEDAL_TYPE_IDENTITY_NAME,
										self::MEDAL_TYPE_PANDUOLA	=> self::MEDAL_TYPE_PANDUOLA_NAME,
										self::MEDAL_TYPE_PAOPAOYU	=> self::MEDAL_TYPE_PAOPAOYU_NAME,
										self::MEDAL_TYPE_KONGLONG	=> self::MEDAL_TYPE_KONGLONG_NAME,
										self::MEDAL_TYPE_MINGXING	=> self::MEDAL_TYPE_MINGXING_NAME,
										self::MEDAL_TYPE_LIMIT		=> self::MEDAL_TYPE_LIMIT_NAME,
										self::MEDAL_TYPE_SPECIAL	=> self::MEDAL_TYPE_SPECIAL_NAME,
										);
    
	//勋章的详细配置信息
    static public $ar_show_info = array(
		self::MEDAL_ACTIVITY_FRESH			=> '您还没有达到领取标准哦~快去上传头像就可以领取啦！',
		self::MEDAL_ACTIVITY_FAITH			=> '您已连续登录%d天，还差%d天才能领取该勋章哦！',
		self::MEDAL_ACTIVITY_FANS			=> '您已登录%d天，还差%d天登录记录才能领取该勋章哦！',
		self::MEDAL_INVITE_GENERAL			=> '您再成功邀请%d位好友来注册盛大帐号就能领取勋章哦！',
		self::MEDAL_INVITE_ENJOY			=> '您再成功邀请%d位好友来注册盛大帐号就能领取勋章哦！',
		self::MEDAL_INVITE_CRAZY			=> '您再成功邀请%d位好友来注册盛大帐号就能领取勋章哦！',
		self::MEDAL_FANS_FRIEND				=> '您还需要增加%d位双向好友才能获此殊荣哦！',
		self::MEDAL_FANS_LOVE				=> '您还需要%d个粉丝哦~继续发挥您的社交魅力吧！',
		self::MEDAL_FANS_STAR				=> '您还需要%d个粉丝哦~继续发挥您的社交魅力吧！',
		self::MEDAL_TWITTER_GROUP			=> '您还需要发表%d篇推他才可以拥有此勋章哦！',
		self::MEDAL_TWITTER_LEADER			=> '您还需要发表%d篇推他才可以拥有此勋章哦！',
		self::MEDAL_TWITTER_LOAD			=> '您的推他还需要被转发%d次才可以拥有此勋章哦！',
		self::MEDAL_IDENTITY_GOLD			=> '您还不是%s，无法拥有此勋章。<a href="http://jf.sdo.com/Help.aspx?innerIndex=ScoreRule&pid=1" target="_blank">点击这里</a>查看详情！',
		self::MEDAL_IDENTITY_RHOD			=> '您还不是%s，无法拥有此勋章。<a href="http://jf.sdo.com/Help.aspx?innerIndex=ScoreRule&pid=1" target="_blank">点击这里</a>查看详情！',
		self::MEDAL_IDENTITY_DIAMOND		=> '您还不是%s，无法拥有此勋章。<a href="http://jf.sdo.com/Help.aspx?innerIndex=ScoreRule&pid=1" target="_blank">点击这里</a>查看详情！',
		self::MEDAL_PANDUOLA_COPPER			=> '再吸引%s个人搬进来就可以领勋章啦~快来盖房子吧！',
		self::MEDAL_PANDUOLA_SILVER			=> '再吸引%s个人搬进来就可以领勋章啦~快来盖房子吧！',
		self::MEDAL_PANDUOLA_GOLD			=> '再吸引%s个人搬进来就可以领勋章啦~快来盖房子吧！',
		self::MEDAL_PAOPAOYU_1				=> '您已达到泡泡鱼%s级，勋章近在咫尺~继续加油吧！',
		self::MEDAL_PAOPAOYU_2				=> '您已达到泡泡鱼%s级，离目标越来越近啦~加油吧！',
		self::MEDAL_PAOPAOYU_3				=> '您已达到泡泡鱼%s级，还差一点点哦~继续加油吧！',
		self::MEDAL_KONGLONG_1				=> '你已达到%s级了，还差点哦~还不快去升级！',
		self::MEDAL_KONGLONG_2				=> '你已达到%s级了，继续加油吧！',
		self::MEDAL_KONGLONG_3				=> '你已达到%s级，离目标越来越近了，加油！',
		self::MEDAL_MINGXING_1				=> '你还需要赚%s才能获取此勋章哦~加油加油！',
		self::MEDAL_MINGXING_2				=> '你还需要赚%s才能获取此勋章哦~加油加油！',
		self::MEDAL_MINGXING_3				=> '你还需要赚%s才能获取此勋章哦~加油加油！',
		self::MEDAL_LIMIT_LONGZHIGU			=> '获得任意5枚糖果勋章即可兑换龙之谷荣誉勋章！',
		self::MEDAL_LIMIT_BANGBANGTANG		=> '您还不是糖果棒棒堂用户哦~<a href="http://t.sdo.com/bbs/index.php?_c=content&post_id=15546" target="_blank">点击这里</a>查看详情',
		self::MEDAL_SPECIAL_PLAYBOY			=> '您只需在任意4种系列勋章中各获得1枚勋章即可拥有%s勋章啦！',
		self::MEDAL_SPECIAL_SHOWMAN			=> '您只需在任意4种系列勋章中各获得2枚勋章即可拥有%s勋章啦！',
		self::MEDAL_SPECIAL_SUPERMAN		=> '您只需在任意4种系列勋章中各获得3枚勋章即可拥有%s勋章啦！',
    );

	static public $ar_medal_info = array(
		self::MEDAL_ACTIVITY_FRESH			=> array( 
											'name'		=> '快乐起航',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_ACTIVITY,
											'type_name'	=> self::MEDAL_TYPE_ACTIVITY_NAME,
											'img'		=> 'activity_1.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_AVATAR_URL,
											's_desc'	=> '上传头像',
											'm_desc'	=> '有面子有身份',
											'desc'		=> '上传头像',
											'next'		=> self::MEDAL_ACTIVITY_FAITH,
											),
		self::MEDAL_ACTIVITY_FAITH			=> array( 
											'name'		=> '忠实用户',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_ACTIVITY,
											'type_name'	=> self::MEDAL_TYPE_ACTIVITY_NAME,
											'img'		=> 'activity_2.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '连续7天登录',
											'm_desc'	=> '经常在这儿溜达',
											'desc'		=> '连续7天登录',
											'next'		=> self::MEDAL_ACTIVITY_FANS,
											),
		self::MEDAL_ACTIVITY_FANS			=> array( 
											'name'		=> '铁杆用户',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_ACTIVITY,
											'type_name'	=> self::MEDAL_TYPE_ACTIVITY_NAME,
											'img'		=> 'activity_3.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '累计登录200天',
											'm_desc'	=> '长期潜伏在此',
											'desc'		=> '累计登录200天',
											'next'		=> 0,
											),
		self::MEDAL_INVITE_GENERAL			=> array( 
											'name'		=> '呼朋引伴',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_INVITE,
											'type_name'	=> self::MEDAL_TYPE_INVITE_NAME,
											'img'		=> 'invite_1.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_INVITE_URL,
											's_desc'	=> '邀请5个好友注册',
											'm_desc'	=> '唤来了5个好友',
											'desc'		=> '成功邀请5个好友注册',
											'next'		=> self::MEDAL_INVITE_ENJOY,
											),
		self::MEDAL_INVITE_ENJOY			=> array( 
											'name'		=> '吸友牛人',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_INVITE,
											'type_name'	=> self::MEDAL_TYPE_INVITE_NAME,
											'img'		=> 'invite_2.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_INVITE_URL,
											's_desc'	=> '邀请10个好友注册',
											'm_desc'	=> '邀请10个好友注册',
											'desc'		=> '成功邀请10个好友注册',
											'next'		=> self::MEDAL_INVITE_CRAZY,
											),
		self::MEDAL_INVITE_CRAZY			=> array( 
											'name'		=> '吸友狂人',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_INVITE,
											'type_name'	=> self::MEDAL_TYPE_INVITE_NAME,
											'img'		=> 'invite_3.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_INVITE_URL,
											's_desc'	=> '邀请20个好友注册',
											'm_desc'	=> '唤来了20个好友',
											'desc'		=> '成功邀请20个好友注册',
											'next'		=> 0,
											),
		self::MEDAL_FANS_FRIEND				=> array( 
											'name'		=> '友爱勋章',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_FANS,
											'type_name'	=> self::MEDAL_TYPE_FANS_NAME,
											'img'		=> 'fans_1.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_SEARCH_URL,
											's_desc'	=> '拥有10个双向好友',
											'm_desc'	=> '团结友爱的小盆友',
											'desc'		=> '拥有10个双向好友',
											'next'		=> self::MEDAL_FANS_LOVE,
											),
		self::MEDAL_FANS_LOVE				=> array( 
											'name'		=> '小有人气',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_FANS,
											'type_name'	=> self::MEDAL_TYPE_FANS_NAME,
											'img'		=> 'fans_2.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_SEARCH_URL,
											's_desc'	=> '被50个人加为好友',
											'm_desc'	=> '灰常受欢迎',
											'desc'		=> '拥有50名粉丝',
											'next'		=> self::MEDAL_FANS_STAR,
											),
		self::MEDAL_FANS_STAR				=> array( 
											'name'		=> '社区明星',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_FANS,
											'type_name'	=> self::MEDAL_TYPE_FANS_NAME,
											'img'		=> 'fans_3.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_SEARCH_URL,
											's_desc'	=> '被500个人加为好友',
											'm_desc'	=> '倍儿有人气',
											'desc'		=> '拥有500名粉丝',
											'next'		=> 0,
											),
		self::MEDAL_TWITTER_GROUP			=> array( 
											'name'		=> '推他一族',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_TWITTER,
											'type_name'	=> self::MEDAL_TYPE_TWITTER_NAME,
											'img'		=> 'twitter_1.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_TUITA_URL,
											's_desc'	=> '发表10条推他',
											'm_desc'	=> '开启推他生活',
											'desc'		=> '发表了10条推他',
											'next'		=> self::MEDAL_TWITTER_LEADER,
											),
		self::MEDAL_TWITTER_LEADER			=> array( 
											'name'		=> '推他潮人',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_TWITTER,
											'type_name'	=> self::MEDAL_TYPE_TWITTER_NAME,
											'img'		=> 'twitter_2.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_TUITA_URL,
											's_desc'	=> '发表100条推他',
											'm_desc'	=> '推他滔滔不绝',
											'desc'		=> '发表了100条推他（每天最多计入10条）',
											'next'			=> self::MEDAL_TWITTER_LOAD
											),
		self::MEDAL_TWITTER_LOAD			=> array( 
											'name'		=> '推他红人',
											'status'	=> self::MEDAL_TYPE_TWITTER,
											'type'		=> self::MEDAL_TYPE_TWITTER,
											'type_name'	=> self::MEDAL_TYPE_TWITTER_NAME,
											'img'		=> 'twitter_3.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_TUITA_URL,
											's_desc'	=> '推他被转发了500次',
											'm_desc'	=> '推他经常被围观',
											'desc'		=> '推他累计被转发了500次',
											'next'		=> 0,
											),
		self::MEDAL_IDENTITY_GOLD			=> array( 
											'name'		=> '黄金会员',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_IDENTITY,
											'type_name'	=> self::MEDAL_TYPE_IDENTITY_NAME,
											'img'		=> 'identity_1.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '成为盛大黄金会员',
											'm_desc'	=> '进入上游社会了',
											'desc'		=> '12个月内充值积分累积达800分 ',
											'next'		=> self::MEDAL_IDENTITY_RHOD,
											),
		self::MEDAL_IDENTITY_RHOD			=> array( 
											'name'		=> '白金会员',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_IDENTITY,
											'type_name'	=> self::MEDAL_TYPE_IDENTITY_NAME,
											'img'		=> 'identity_2.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '成为盛大白金会员',
											'm_desc'	=> '贵族的象征',
											'desc'		=> '12个月内充值积分累积达2400分',
											'next'		=> self::MEDAL_IDENTITY_DIAMOND,
											),
		self::MEDAL_IDENTITY_DIAMOND		=> array( 
											'name'		=> '钻石会员',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_IDENTITY,
											'type_name'	=> self::MEDAL_TYPE_IDENTITY_NAME,
											'img'		=> 'identity_3.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '成为盛大钻石会员',
											'm_desc'	=> '贵族中的贵族',
											'desc'		=> '12个月内充值积分累积达40000分',
											'next'		=> 0,
											),
		self::MEDAL_PANDUOLA_COPPER			=> array( 
											'name'		=> '青铜勋章',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_PANDUOLA,
											'type_name'	=> self::MEDAL_TYPE_PANDUOLA_NAME,
											'img'		=> 'panduola_1.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_PANDUOLA_URL,
											's_desc'	=> '拥有5000人口',
											'm_desc'	=> '拥有壮大的村庄	',
											'desc'		=> '拥有的人口达到5,000',
											'next'		=> self::MEDAL_PANDUOLA_SILVER,
											),
		self::MEDAL_PANDUOLA_SILVER			=> array( 
											'name'		=> '白银勋章',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_PANDUOLA,
											'type_name'	=> self::MEDAL_TYPE_PANDUOLA_NAME,
											'img'		=> 'panduola_2.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_PANDUOLA_URL,
											's_desc'	=> '拥有100,000人口',
											'm_desc'	=> '拥有发展中星球',
											'desc'		=> '拥有的人口达到100,000',
											'next'		=> self::MEDAL_PANDUOLA_GOLD,
											),
		self::MEDAL_PANDUOLA_GOLD			=> array( 
											'name'		=> '黄金勋章',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_PANDUOLA,
											'type_name'	=> self::MEDAL_TYPE_PANDUOLA_NAME,
											'img'		=> 'panduola_3.png',
											'time'		=> '2010年5月18日',
											'url'		=> MEDAL_PANDUOLA_URL,
											's_desc'	=> '拥有2,500,000人口',
											'm_desc'	=> '拥有梦幻大都市',
											'desc'		=> '拥有的人口达到2,500,000',
											'next'		=> 0,
											),	
		self::MEDAL_PAOPAOYU_1				=> array( 
											'name'		=> '新晋渔民',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_PAOPAOYU,
											'type_name'	=> self::MEDAL_TYPE_PAOPAOYU_NAME,
											'img'		=> 'paopaoyu_1.png',
											'time'		=> '2010年6月21日',
											'url'		=> MEDAL_PAOPAOYU_URL,
											's_desc'	=> '升到泡泡鱼2级',
											'm_desc'	=> '泥腿子新手',
											'desc'		=> '在泡泡鱼游戏达到2级',
											'next'		=> self::MEDAL_PAOPAOYU_2,
											),	
		self::MEDAL_PAOPAOYU_2				=> array( 
											'name'		=> '祖传渔民',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_PAOPAOYU,
											'type_name'	=> self::MEDAL_TYPE_PAOPAOYU_NAME,
											'img'		=> 'paopaoyu_2.png',
											'time'		=> '2010年6月21日',
											'url'		=> MEDAL_PAOPAOYU_URL,
											's_desc'	=> '升到泡泡鱼7级',
											'm_desc'	=> '祖传手艺的渔民',
											'desc'		=> '在泡泡鱼游戏达到7级',
											'next'		=> self::MEDAL_PAOPAOYU_3,
											),	
		self::MEDAL_PAOPAOYU_3				=> array( 
											'name'		=> '神迹渔民',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_PAOPAOYU,
											'type_name'	=> self::MEDAL_TYPE_PAOPAOYU_NAME,
											'img'		=> 'paopaoyu_3.png',
											'time'		=> '2010年6月25日',
											'url'		=> MEDAL_PAOPAOYU_URL,
											's_desc'	=> '升到泡泡鱼15级',
											'm_desc'	=> '俺是个传说',
											'desc'		=> '在泡泡鱼游戏达到15级',
											'next'		=> 0,
											),	
		self::MEDAL_KONGLONG_1				=> array( 
											'name'		=> '正式原始人',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_KONGLONG,
											'type_name'	=> self::MEDAL_TYPE_KONGLONG_NAME,
											'img'		=> 'konglong_1.png',
											'time'		=> '2010年6月21日',
											'url'		=> MEDAL_KONGLONG_URL,
											's_desc'	=> '在恐龙时代达到10级',
											'm_desc'	=> '通过原始生活的初步考验',
											'desc'		=> '在恐龙时代达到10级',
											'next'		=> self::MEDAL_KONGLONG_2,
											),	
		self::MEDAL_KONGLONG_2				=> array( 
											'name'		=> '熟练原始人',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_KONGLONG,
											'type_name'	=> self::MEDAL_TYPE_KONGLONG_NAME,
											'img'		=> 'konglong_2.png',
											'time'		=> '2010年6月25日',
											'url'		=> MEDAL_KONGLONG_URL,
											's_desc'	=> '在恐龙时代达到30级',
											'm_desc'	=> '获得原始生活的熟练证书',
											'desc'		=> '在恐龙时代达到30级',
											'next'		=> self::MEDAL_KONGLONG_3,
											),	
		self::MEDAL_KONGLONG_3				=> array( 
											'name'		=> '资深原始人',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_KONGLONG,
											'type_name'	=> self::MEDAL_TYPE_KONGLONG_NAME,
											'img'		=> 'konglong_3.png',
											'time'		=> '2010年6月25日',
											'url'		=> MEDAL_KONGLONG_URL,
											's_desc'	=> '在恐龙时代达到50级',
											'm_desc'	=> '专家级原始生活达人',
											'desc'		=> '在恐龙时代达到50级',
											'next'		=> 0,
											),	
		/*
		self::MEDAL_MINGXING_1				=> array( 
											'name'		=> '百万富翁',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_MINGXING,
											'type_name'	=> self::MEDAL_TYPE_MINGXING_NAME,
											'img'		=> 'paopaoyu_3.png',
											'time'		=> '2010年6月25日',
											'url'		=> MEDAL_MINGXING_URL,
											's_desc'	=> '拍电影出专辑赚钱',
											'm_desc'	=> '百万富翁',
											'desc'		=> '公司资产达到100万',
											'next'		=> self::MEDAL_MINGXING_2,
											),	
		self::MEDAL_MINGXING_2				=> array( 
											'name'		=> '千万富翁',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_MINGXING,
											'type_name'	=> self::MEDAL_TYPE_MINGXING_NAME,
											'img'		=> 'paopaoyu_3.png',
											'time'		=> '2010年6月25日',
											'url'		=> MEDAL_MINGXING_URL,
											's_desc'	=> '拍电影出专辑赚钱',
											'm_desc'	=> '千万富翁',
											'desc'		=> '公司资产达到1000万',
											'next'		=> self::MEDAL_MINGXING_3,
											),	
		self::MEDAL_MINGXING_3				=> array( 
											'name'		=> '亿万富翁',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_MINGXING,
											'type_name'	=> self::MEDAL_TYPE_MINGXING_NAME,
											'img'		=> 'paopaoyu_3.png',
											'time'		=> '2010年6月25日',
											'url'		=> MEDAL_MINGXING_URL,
											's_desc'	=> '开世界巡回演唱会',
											'm_desc'	=> '亿万富翁',
											'desc'		=> '公司资产达到1亿',
											'next'		=> 0,
											),*/
		self::MEDAL_SPECIAL_PLAYBOY			=> array( 
											'name'		=> '广泛涉猎',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_SPECIAL,
											'type_name'	=> self::MEDAL_TYPE_SPECIAL_NAME,
											'img'		=> 'special_1.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '集齐4种勋章',
											'm_desc'	=> '混了个脸熟',
											'desc'		=> '在任意4种系列中均获得了1枚勋章',
											'next'		=> self::MEDAL_SPECIAL_SHOWMAN,
											),
		self::MEDAL_SPECIAL_SHOWMAN			=> array( 
											'name'		=> '社区达人',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_SPECIAL,
											'type_name'	=> self::MEDAL_TYPE_SPECIAL_NAME,
											'img'		=> 'special_2.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '集齐8种勋章',
											'm_desc'	=> '在这儿混得不错',
											'desc'		=> '在任意4种系列中均获得了2枚勋章',
											'next'		=> self::MEDAL_SPECIAL_SUPERMAN,
											),
		self::MEDAL_SPECIAL_SUPERMAN		=> array( 
											'name'		=> '超级玩家',
											'status'	=> self::MEDAL_TYPE_SPECIAL,
											'type'		=> self::MEDAL_TYPE_SPECIAL,
											'type_name'	=> self::MEDAL_TYPE_SPECIAL_NAME,
											'img'		=> 'special_3.png',
											'time'		=> '2010年5月18日',
											'url'		=> '',
											's_desc'	=> '集齐12种勋章',
											'm_desc'	=> '相当滴会玩哇',
											'desc'		=> '在任意4种系列中均获得了3枚勋章',
											'next'		=> 0,
										),
		self::MEDAL_LIMIT_NEICE			    => array(
											'name'		=> '糖果首发用户',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_LIMIT,
											'type_name'	=> self::MEDAL_TYPE_LIMIT_NAME,
											'img'		=> 'limit_1.png',
											'time'		=> '2010年6月1日—2010年7月1日',
											'url'		=> '',
											's_desc'	=> '成为糖果测试版用户',
											'm_desc'	=> '糖果首批用户',
											'desc'		=> '仅限在盛大糖果社区测试阶段顺利激活账号的用户。',
											'next'		=> 0,
											),
		self::MEDAL_LIMIT_LONGZHIGU			=> array(
											'name'		=> '龙之谷荣誉勋章',
											'status'	=> self::MEDAL_STATUS_OFF,
											'type'		=> self::MEDAL_TYPE_LIMIT,
											'type_name'	=> self::MEDAL_TYPE_LIMIT_NAME,
											'img'		=> 'limit_2.png',
											'time'		=> '2010年6月9日—2010年6月21日',
											'url'		=> '',
											's_desc'	=> '获得任意5枚糖果勋章',
											'm_desc'	=> '糖果限量发行',
											'desc'		=> '获得任意5枚勋章即可获得龙之谷荣誉勋章。',
											'award'		=> '参加活动抢夺龙之谷激活码！',
											'next'		=> 0,
											),
		self::MEDAL_LIMIT_BANGBANGTANG		=> array(
											'name'		=> '棒棒堂勋章',
											'status'	=> self::MEDAL_STATUS_ON,
											'type'		=> self::MEDAL_TYPE_LIMIT,
											'type_name'	=> self::MEDAL_TYPE_LIMIT_NAME,
											'img'		=> 'limit_3.png',
											'time'		=> '2010年6月21日	',
											'url'		=> '',
											's_desc'	=> '加入棒棒堂',
											'm_desc'	=> '糖果棒棒堂用户',
											'desc'		=> '加入棒棒堂，成为糖果很棒很棒的用户！',
											'next'		=> 0,
											),
	);
}

function medal2dbconfig()
{
	if('DEV'==__UC_ENV)
	{
		return array(
			'driver' => 'mysql',
			'host' => '10.129.128.14',
			'port' => '3306',
			'username' => 'root',
			'password' => '123qwe',
			'database' => 'd_medal',
			'table' => 't_medal'
		);
	}
	else if('TEST'==__UC_ENV)
	{
		return array(
			'driver' => 'mysql',
			'host' => '10.10.85.4',
			'port' => '8066',
			'username' => 'ucdbuser',
			'password' => 'sdf2w@!w',
			'database' => 'd_medal',
			'table' => 't_medal'
		);
	}
	else
	{
		return array(
			'driver' => 'mysql',
			'host' => '10.150.9.5',
			'port' => '8066',
			'username' => 'ucdbuser',
			'password' => '(qnO-ps:Oi^0F0',
			'database' => 'd_medal',
			'table' => 't_medal'
		);
	}
}
?>